home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
os2
/
4os295.zip
/
4OS2.DOC
next >
Wrap
Text File
|
1992-03-27
|
139KB
|
2,956 lines
44
44
44 OOOOO SSSSSS 222222
44 OOOOOOO SSSSSSSS 22222222
44 44 OO OO SS 22 22
44 44 OO OO SS 22
44 44 OO OO SSSSSS 222
444444444 OO OO SSSSSS 222
44444444 OO OO SS 222
44 OO OO SS 222
44 OOOOOOO SSSSSSSS 222222222
44 OOOOO SSSSSS 222222222
Version 0.95 (Shareware Pre-Release)
Developed By
Rex Conn and Tom Rawson
Documentation By
Hardin Brothers, Tom Rawson, and Rex Conn
Published By
JP Software Inc.
P.O. Box 1470
East Arlington, MA 02174
USA
(617) 646-3975
fax (617) 646-0904
Program and Documentation Copyright 1988, 1989, 1990, 1991,
1992, Rex C. Conn and JP Software Inc., All Rights Reserved.
4OS2 is a trademark and 4DOS is a registered trademark of JP
Software Inc. OS/2 is a registered trademark of IBM
Corporation. Other product and company names are trademarks
of their respective owners.
ACKNOWLEDGMENTS
We couldn't produce a product like 4OS2 without the dedication
and quality work of many people. Our thanks to:
JP Software Staff: Mike Bessy, Kevin Cocilo, Helen
Coyne, Hayyim Feldman, Henry Harvey, Ellen Stone, Misty
White.
Beta Test Support: David Moskowitz, Guy Scharf, Larry
Finkelstein, and Martin Schiff, of CompuServe's CONSULT
forum.
Online Support: Brian Miller and Tess Heder of Channel 1
BBS; Don Watkins of CompuServe's IBMNET.
Help Text Conversion: Matthew J. Palcic.
Beta Testers: We can't list all of our beta testers
here! A special thanks to all of you who helped make
4OS2 elegant, reliable, and friendly!
The following tools are used in creating and maintaining 4OS2
and the 4OS2 Help:
Compilers: Microsoft C 6.0 and Macro Assembler 5.1
and 6.0
Libraries: Spontaneous Assembly (Base Two
Development)
Editors: Edix (Emerging Technology), Brief
(Solution Systems)
Version Control: PVCS (Sage Software)
Help Compiler: IBM Information Presentation Facility
Documentation: Microsoft Word for Windows with Adobe Type
Manager
Printing by Causeway Print, Boston. Disk duplication by
Diversified Systems Group, Issaquah, WA.
CONTENTS
___________________________________________________________________
Contents
Introduction .......................................... 1
How to Use This Manual ........................... 2
Chapter 1 / Installation .............................. 4
Installing 4OS2 .................................. 4
Manual 4OS2 Installation ......................... 4
Manual Installation for OS/2 Version 1.x .... 5
Manual Installation for OS/2 Version 2.0 .... 5
Uninstalling 4OS2 ................................ 6
Chapter 2 / General Concepts .......................... 7
Terminology ...................................... 7
OS/2 Sessions and Applications ................... 7
Sessions and Session Types .................. 8
Applications and Application Types .......... 10
Starting Sessions and Applications .......... 11
Creating and Configuring Icons ................... 12
OS/2 Version 1.x Icons ...................... 12
OS/2 Version 2.0 Icons ...................... 13
Primary and Secondary Shells ..................... 13
High Performance File System (HPFS) .............. 14
Extended Attributes .............................. 15
Chapter 3 / Using 4OS2 ................................ 16
At the Command Line .............................. 16
4OS2 HELP ................................... 16
Shared History and Alias Lists .............. 17
Multiple Commands ........................... 18
Escape Character ............................ 18
Redirection ...................................... 18
Piping ........................................... 19
4OS2 Internal Variables .......................... 20
4OS2 Variable Functions .......................... 20
Batch Files ...................................... 21
4OS2 Startup and Exit Files ................. 22
Using STARTUP.CMD ........................... 22
Using 4START and 4EXIT ...................... 23
REXX Support ................................ 23
EXTPROC Support ............................. 24
Chapter 4 / Configuration and Tuning .................. 26
Creating and Configuring 4OS2 Icons .............. 26
4OS2 Command Line Options ........................ 27
Using 4OS2.INI ................................... 29
4OS2.INI Directives ......................... 29
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / i
CONTENTS
___________________________________________________________________
Configuring 4OS2 Help ............................ 30
Using 4DOS with OS/2 ............................. 31
Methods of Booting .......................... 33
Setting Up OS/2 and 4DOS .................... 34
Other 4DOS Considerations ................... 36
"Temporary" VDMs ............................ 37
Chapter 5 / Command Reference Guide ................... 39
DETACH ........................................... 40
DIR .............................................. 41
DPATH ............................................ 42
KEYS ............................................. 43
SETDOS ........................................... 45
START ............................................ 46
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / ii
INTRODUCTION
___________________________________________________________________
INTRODUCTION
Welcome, and thanks for trying 4OS2!
We developed 4OS2 to bring the power and convenience of our
popular 4DOS program to users of the OS/2 operating system.
Whether you are a computer novice or an experienced user, we
think that 4OS2 will help you get the most out of your OS/2
computer.
4OS2, like its cousin 4DOS, is a command interpreter or
"shell." We have designed 4OS2 to be compatible with both
4DOS and with OS/2's normal shell program, which is called
CMD.EXE.
If you are familiar with 4DOS or with the OS/2 command prompt,
you won't have to change your computing habits or unlearn
anything to use 4OS2. If you know how to display a directory,
copy a file, or start an application program, you already know
how to use 4OS2. And if you are a 4DOS user, you already know
how to use most of the advanced features that we have built
into 4OS2. You can even use many of your 4DOS batch files
with 4OS2 without changing them at all.
Once you have 4OS2 installed, you can learn its new features
at your own pace. Relax, enjoy 4OS2's power, and browse
through the manuals occasionally. Press the F1 key whenever
you need help. 4OS2 will soon become an essential part of
your computer, and you'll wonder how you ever got along
without it.
This version of 4OS2 is designed for and has been tested with
OS/2 versions 1.2,. 1.21, 1.3, and 2.0. You must have one of
these versions of OS/2 operating on your computer to be able
to install and use 4OS2.
We are constantly working to improve 4OS2. If you have
suggestions for features or commands that we should include in
the next version, or any other way we could improve our
product, please let us know. Many of the features in this
version of 4OS2 were suggested by our users and beta testers,
and while we can't promise to include every suggestion, we
really do appreciate and pay attention to your comments.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 1
INTRODUCTION
___________________________________________________________________
How to Use This Manual
Because 4OS2 is almost identical to 4DOS in operation, nearly
everything in the 4DOS Reference Manual applies to 4OS2 as
well. Therefore, we supply both this manual and the 4DOS
Reference Manual with every copy of 4OS2. Use the 4DOS
Reference Manual as your main 4OS2 manual; this booklet is a
supplement which explains the added features in 4OS2 and the
occasional differences between the two products.
We publish the manuals in this form because most 4OS2
customers also use 4DOS. This supplement helps focus
attention on the few differences between 4OS2 and 4DOS; two
completely separate manuals would make those differences more
difficult to pinpoint and to remember.
If you aren't already familiar with 4DOS, we urge you to
install it in the OS/2 DOS box (OS/2 version 1.x) or a Virtual
Dos Machine (VDM of OS/2 version 2.0). Try the Guided Tour of
4DOS (see chapter 3 of the 4DOS Reference Manual) and then
experiment with 4DOS. Once you are familiar with 4DOS,
install 4OS2. Installation instructions for both products are
in the next chapter.
If you are familiar with 4DOS, you may want to read quickly
through this manual to get a general feeling for the few
differences between the two products. Then you can install
4OS2 on your computer and study the differences that affect
your computing habits in detail.
There are five chapters in this supplement. Here is what
you'll find in each:
Chapter 1 / Installation
This chapter explains how to install 4OS2. Because the
installation instructions vary depending on the version
of OS/2 that you are using, everyone should read this
short chapter.
Chapter 2 / General Concepts
OS/2 is a rich operating system with a wide range of
features. We don't have the space for a complete OS/2
tutorial, but some of the concepts and terms you need to
configure and make full use of 4OS2 are explained in this
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 2
INTRODUCTION
___________________________________________________________________
chapter. Even if you are an experienced OS/2 user, we
encourage you to read Chapter 2 before using 4OS2
extensively.
Chapter 3 / Using 4OS2
This chapter explains the differences between 4DOS and
4OS2. It is meant to be used as a supplement to Chapter
5 / Using 4DOS in the 4DOS Reference Manual.
Chapter 4 / Options and Tuning
This chapter discusses how to configure 4OS2. It also
explains how to configure 4DOS to run most efficiently as
the command processor for DOS sessions under OS/2.
Chapter 5 / Command Reference
The final chapter provides the details about the commands
which are new in 4OS2 and about those which differ from
4DOS. It is meant to be used as a supplement to Chapter
8 / 4DOS Command Reference in the 4DOS Reference Manual.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 3
CHAPTER 1 / INSTALLATION
___________________________________________________________________
CHAPTER 1 / INSTALLATION
Before you install 4OS2 (or any other software, for that matter),
you should make a bootable system diskette so you can recover in
case of a power failure or other interruption during the
installation process. The easiest way to do so is to create a
bootable DOS system disk (see page 13 of the 4DOS reference
manual). If necessary, you can use your OS/2 installation disks to
boot your system, then exit the installation program at the first
opportunity and return to an OS/2 (CMD.EXE) command prompt.
Installing 4OS2
See the sections below for specific instructions on installing
4OS2 manually under OS/2 version 1.x, or manually under OS/2
version 2.0.
Once you have 4OS2 installed, the standard "OS/2 Window" and
"OS/2 Full Screen" selections in your Group-Main window (OS/2
version 1.x) or Command Prompts folder (OS/2 version 2.0) will
start 4OS2 instead of CMD.EXE (unless they have been changed
from their default configuration). You may wish to change the
names of these selections to "4OS2 Window" and "4OS2 Full
Screen".
If you have a STARTUP.CMD batch file, OS/2 will create a 4OS2
session at boot time and pass the STARTUP.CMD command to that
session, just as it did with CMD.EXE before 4OS2 was
installed.
For information about creating additional 4OS2 icons,
configuring 4OS2, and setting up startup batch files for
specific 4OS2 sessions, see pages 12 and 26.
Manual 4OS2 Installation
For this special shareware pre-release version the 4OS2 files
are contained in a ZIP or other similar compressed file which
you downloaded. Extract these files onto your hard disk.
Place the files in their own directory. In the examples
below, we have assumed that the files are in the C:\4OS2
directory.
Once you have extracted the files, you can test drive 4OS2
before completing the installation. To do so, start an OS/2
windowed or full-screen session from the Presentation Manager
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 4
CHAPTER 1 / INSTALLATION
___________________________________________________________________
desktop. At the CMD.EXE prompt, change to the directory where
4OS2 is installed, and enter the command 4OS2. When you're
ready to finish the installation process, follow the
instructions in the appropriate section below. Before you
modify CONFIG.SYS, be sure you have a bootable floppy disk as
discussed above.
Manual Installation for OS/2 Version 1.x
Use an ASCII-format editor to load and edit your OS/2
CONFIG.SYS file. In the file, you will find a line that
begins with the word PROTSHELL and another that begins with
the words SET COMSPEC. The lines should look something like
this, but they may not be adjacent in the file (the PROTSHELL
command is all on one line):
PROTSHELL=C:\OS2\PMSHELL.EXE C:\OS2\OS2.INI
C:\OS2\OS2SYS.INI C:\OS2\CMD.EXE
SET COMSPEC=C:\OS2\CMD.EXE
Change the last item on the PROTSHELL line, the item that
includes the filename CMD.EXE, to point to 4OS2.EXE. Be sure
to include the full path for 4OS2.EXE. The changed PROTSHELL
line should look something like this (it should all be on one
line):
PROTSHELL=C:\OS2\PMSHELL.EXE C:\OS2\OS2.INI
C:\OS2\OS2SYS.INI C:\4OS2\4OS2.EXE
Do not change PMSHELL.EXE to 4OS2.EXE. Change only the name
and path of CMD.EXE.
Now change the SET COMSPEC line so that it also contains the
full path of 4OS2.EXE. The completed line should look like
this:
SET COMSPEC=C:\4OS2\4OS2.EXE
Verify that the changes have been made correctly and then save
the CONFIG.SYS file. Exit from your editor and then reboot
your system.
Manual Installation for OS/2 Version 2.0
Use an ASCII-format editor to load and edit your OS/2
CONFIG.SYS file. In the file, you will find a line that
begins with the words SET OS2_SHELL and another that begins
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 5
CHAPTER 1 / INSTALLATION
___________________________________________________________________
with the words SET COMSPEC. The lines should look something
like this, but they may not be adjacent in the file:
SET OS2_SHELL=D:\OS2\CMD.EXE
SET COMSPEC=D:\OS2\CMD.EXE
Change both of these lines so that they to point to 4OS2.EXE,
including its path, instead of to the CMD.EXE file. When you
are done, the lines should look something like this:
SET OS2_SHELL=C:\4OS2\4OS2.EXE
SET COMSPEC=C:\4OS2\4OS2.EXE
Verify that the changes have been made correctly and then save
the CONFIG.SYS file. Exit from your editor and then reboot
your system.
Uninstalling 4OS2
In the extremely unlikely event that you have trouble with
your computer after you install 4OS2, you can remove it quite
easily. We don't expect you to have any trouble, but we know
some people feel more secure knowing how to uninstall a
product as well as install it. Or, you may need to remove
4OS2 from one system if you are moving it to another system.
To temporarily remove 4OS2 from you system, use an ASCII
editor to edit your OS/2 CONFIG.SYS file. You will need to
edit both the SET COMSPEC line (all versions of OS/2) and
either the PROTSHELL line (OS/2 version 1.x) or SET OS2_SHELL
line (OS/2 version 2.0). In all cases, change the reference
to 4OS2.EXE to the complete path and filename of CMD.EXE.
Save the file, exit from your editor, shut down OS/2, and
reboot your system. OS/2 will boot using CMD.EXE as its
command processor.
To permanently remove 4OS2, follow the instructions above.
You will also want to change or delete any Group Main
selections (in OS/2 version 1.x) or icons (in OS/2 version
2.0) that refer directly to 4OS2.EXE. Then delete all 4OS2
files on your hard drive to completely uninstall 4OS2.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 6
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
CHAPTER 2 / GENERAL CONCEPTS
This chapter contains information about OS/2 and 4OS2. Some of the
information is general and introductory in nature; other parts of
this chapter are fairly detailed and technical. We encourage you
to at least scan through this chapter to see what is here and to
study the sections that appear to have relevance to your way of
using 4OS2 and OS/2.
Terminology
Throughout this manual, the term "desktop" refers to the
Presentation Manager in OS/2 version 1.x or the Workplace
Shell in OS/2 version 2.0.
The term "icon" refers to a selectable item on your desktop,
whether or not the corresponding icon is actually visible (you
may have chosen to configure the desktop with only session
names visible, rather than the icons themselves). For
example, the standard desktop for all versions of OS/2
includes icons titled "OS/2 Windowed" and "OS/2 Full-Screen".
The term "session" refers to the OS/2 session created by
selecting an icon on the desktop. Sessions are used to run a
program or sequence of programs. See below for more
information on sessions and session types. When you double-
click on an icon or select it with the keyboard and press
Enter, a new session is started.
The term "process" refers to a single invocation of a
particular program within a session. Many sessions run only a
single process. However, multiple processes can run
simultaneously within the same session. For example, in a
4OS2 session which uses a pipe to send the output of one
program to the input of another, two processes run
simultaneously: the program generating the output and the
program receiving it.
OS/2 Sessions and Applications
OS/2 supports several different types of applications and many
methods for starting them. Most of the time, you don't need
to worry about these differences because 4OS2 and OS/2 itself
cooperate to take care of them for you. You may, however,
find this general discussion of applications and sessions
useful to understand what happens when you enter a command to
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 7
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
run an application or other external program. If you need
more details, see the OS/2 online reference information.
Technical experts will recognize that these explanations are
not precise, but they should serve as a useful introduction
for many users. (For example, this introduction does not
explore the distinction between sessions and screen groups.)
Sessions and Session Types
OS/2 programs are run in "sessions" which are programs or
groups of programs whose output typically appears in specific
windowed display areas on the desktop ("windowed" sessions) or
takes up the whole screen ("full screen" sessions).
A windowed session runs in a graphical window whose size you
(or an OS/2 application) can change. As a result, portions of
the session's display area may be covered or invisible at any
given time. The "active" session, or the session which may
receive keystrokes, is always shown with a highlighted title
bar.
Full-screen sessions run on a standard text mode display,
generally 80 characters by 25 lines. When such a session is
active, its full display area is visible and it hides all
other sessions and the desktop itself. You can use the Alt-
Esc key to switch back to the desktop from a full-screen
session.
OS/2 supports ten different types of sessions:
OS/2 Presentation Manager (PM) session: A PM session
runs in graphics mode on the desktop. PM sessions are
always windowed. Their output is graphical and may
include pictures and text in a variety of fonts within
the same window. Examples of PM sessions include those
started to view the OS/2 command reference, or to run the
Enhanced Editor distributed with OS/2.
OS/2 character mode, full-screen session: This session
type displays only text in character mode, like a
standard DOS application. It uses the entire screen,
almost always in standard 80 x 25 text mode. Examples
include a 4OS2 or CMD.EXE full-screen session.
OS/2 character mode, windowed session: This session type
is just like the character mode full-screen session
except that it runs in a window. It uses the same text
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 8
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
font over the entire window and does not display
graphics. Examples include a 4OS2 or CMD.EXE windowed
session.
DOS full-screen session: A DOS session runs DOS within
OS/2. A special version of DOS, designed to run in such
a session, is supplied with OS/2 and is generally
compatible with MS-DOS 5.0. A DOS full-screen session
has full control of the screen (including the ability to
switch it into graphics and non-standard text modes). In
OS/2 version 1.x, you can start exactly one DOS session,
called the "DOS compatibility box." Once this session is
started, it cannot be closed (although you can switch
back to the desktop with Alt-Esc). In OS/2 version 2.0,
you can start many such sessions, which are called
Virtual DOS Machines (VDMs). VDMs can be terminated with
the EXIT command. One example of a DOS full-screen
session is the session started by the default "DOS full-
screen" icon which is installed automatically with OS/2.
DOS windowed session: Available only in OS/2 version
2.0, this session is similar to a DOS full-screen
session. However, it runs in a window on the desktop and
can be resized. Such a session always runs as a VDM and
can be terminated with the EXIT command. You can switch
a windowed DOS session into full-screen mode or back to a
window by pressing Alt-Home. A DOS windowed session can
run all text-mode DOS applications, and certain
applications which display graphics in standard graphics
video modes.
Native DOS full-screen session: Native DOS sessions are
only available in OS/2 version 2.0. They are similar to
the DOS sessions described above, but load a specific
version of DOS (for example, MS-DOS 3.3) into a VDM,
rather than the version of DOS shipped with OS/2 version
2.0. Like normal DOS sessions, native DOS sessions can
be switched between full-screen and windowed mode by
pressing Alt-Home. Once a native DOS session is started
it cannot be terminated with the EXIT command. The only
way to terminate such a session is to switch it to
windowed mode, bring up the system menu for the window,
click Close, and then click Yes to the following prompt.
For more information on native DOS sessions, see the
command VMDISK and the topic "Starting a Specific Version
of DOS" in the on-line Command Reference for OS/2 version
2.0.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 9
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
Native DOS windowed session: This session is similar to
a native DOS full-screen session, but it runs in a window
on the desktop instead of in full-screen mode.
Windows full-screen session: This session type is
available only in OS/2 version 2.0. A Windows full-
screen session is essentially a DOS full-screen session
that is running the special version of Microsoft Windows
that is supplied with OS/2 version 2.0. It has the
standard Windows display, the Program Manager and Control
Panel, etc., and can run Windows applications, but it
cannot start OS/2 or DOS applications.
WIN-OS/2 full-screen session: This session type is
available only in OS/2 version 2.0. It is similar to a
Windows full-screen session, but runs only a single
application.
WIN-OS/2 windowed session: This session type is
available only in OS/2 version 2.0. It allows a single
Windows application to run inside a window on the
Workplace Shell desktop without loading the Windows
Program Manager. Internally, it starts a DOS session and
tells DOS to load the special version of Windows that
comes with OS/2. However, no DOS character-mode window
is opened for this session -- only a graphical
Presentation Manager window for the Windows application.
This session type is sometimes called a "seamless
Windows" session.
Applications and Application Types
OS/2 and 4OS2 support six different types of applications.
Application types are related to the type of session in which
the application can run. They are similar to, but not the
same as, session types. The type of an application is
determined by the programmer when the application is created.
Information about the application type is embedded in the
application itself.
The application types are:
OS/2 Presentation Manager application: Runs in a PM
session only. Examples include the OS/2 online help
program VIEW.EXE and the PM Chart utility distributed
with OS/2.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 10
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
OS/2 character mode, full-screen application: Runs in a
full-screen OS/2 session only. Applications of this type
are very rare.
OS/2 character mode, window-compatible application: Runs
in a full-screen or windowed OS/2 session. Most OS/2
character-mode applications -- including 4OS2 -- are in
this category. This and the previous type are sometimes
called "VIO" or "AVIO" applications.
DOS application: Runs in a DOS session only. Examples
include all .COM and .EXE files designed to run under
DOS, such as those for your DOS communications program or
word processor. Virtually all DOS application programs
that use text displays will run in either a full-screen
or windowed DOS session. Many DOS applications which use
graphics will run properly only in a full-screen DOS
session. 4OS2 recognizes DOS batch files with a .BAT
extension as DOS applications.
"Bound application" or "Family-mode application": Runs
in an OS/2 or a DOS character mode session from the same
.EXE file. Bound applications are primarily used in
compilers and installation programs to allow the same
file to run under both DOS and OS/2.
Windows application: Runs only in a Windows session.
Examples include applications like Word for Windows and
Corel Draw. Most Windows applications will run properly
in either a Windows full-screen session or a WIN-OS/2
full-screen or windowed session.
Starting Sessions and Applications
Before you can start an application program to do some work,
you must have a session in which to execute it. Every icon on
the OS/2 desktop represents a potential session: if you
double-click the icon or select it and press Enter, OS/2
starts a new session with the parameters which have been set
up for that icon.
The parameters for the icon may cause the session to run an
OS/2 application program, load the OS/2 command processor
(CMD.EXE by default, or 4OS2 if you have it installed) and
display a prompt, run a batch file which could in turn start
other sessions, or start DOS, Windows, or a Windows
application.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 11
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
To start 4OS2, you must define an icon for an OS/2 character
mode session, either full-screen or windowed. To do so, see
Chapter 4 / Options and Tuning (page 26) for full
instructions. Briefly, after you have installed 4OS2 and
defined it as your shell in your CONFIG.SYS file, you merely
have to place an asterisk [*] in the field for the program
name. You can also explicitly specify the full path and name
of 4OS2.EXE instead of using the [*] if CONFIG.SYS has not
been set up yet.
Once 4OS2 has started, you can start applications or other
sessions from the 4OS2 prompt. When you start an application,
4OS2 checks its type. If the type is the same as that of the
session in which 4OS2 is running (which will only happen for
OS/2 character-mode applications), the application will run in
the same session as 4OS2, and 4OS2 will wait for the
application to complete before displaying a new prompt. This
is analogous to how applications are run in DOS.
If the application type is different from the 4OS2 session
type, 4OS2 will start a new session to run the application.
Then 4OS2 will wait for that session to signal completion
before returning to the prompt. You can also force 4OS2 to
start a new session and not wait for it to complete by using
the START command (see page 46).
Creating and Configuring Icons
This section gives you basic information which you will need
to create and configure 4OS2 and 4DOS icons on your OS/2
desktop. For complete details on creating and configuring
icons, see your OS/2 documentation. For details on the
appropriate properties or settings to use for 4OS2 and 4DOS
icons see pages 27 (4OS2) and 31 (4DOS).
OS/2 Version 1.x Icons
In OS/2 version 1.x icons are displayed within groups on the
desktop. For example, the "OS/2 Full-screen" icon normally
appears in Group-Main.
To create a new icon, switch to the group where you want the
icon to appear and choose the New selection on the File menu.
Then adjust the icon's properties.
To adjust the properties of an icon, first select it (click on
the icon once, or use the arrow keys on the keyboard), then
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 12
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
open the File Properties menu from the menu bar. From within
this menu you can modify the program name, startup directory,
command line parameters, and other configuration data for the
icon.
OS/2 Version 2.0 Icons
In OS/2 version 2.0, icons may appear on the desktop itself or
within folders. For example, the "OS/2 Full-screen" icon
normally appears in the "Command Prompts" folder.
To create a new icon, switch to the folder where you want the
icon to appear and either copy an existing icon (use either
the Copy or Create Another selection on the icon's popup menu)
or drag a Program Template in from the Templates folder.
Depending on the copying method you choose, the Settings
window may open automatically.
To adjust the properties of an icon, you must open its
Settings window. To do so, click the right mouse button in
the icon. When the popup menu appears, click the left mouse
button on the small arrow to the right of the Open selection,
then again on the Settings selection on the submenu.
Once the Settings window is open, use the Program notebook tab
to modify the program name, startup directory, and command
line parameters. The Session tab lets you set the session
type. Other tabs let you adjust other configuration data for
the icon.
The contents of the Settings window will vary depending on the
type of icon and the session type set on the Session tab. For
example, DOS and Windows sessions allow control of a wide
variety of DOS parameters (such as available XMS and EMS
memory, whether DOS is loaded high, or the maximum number of
open files) using the "DOS Settings" or "Windows Settings"
button. However, this button cannot be used for Presentation
Manager or OS/2 character-mode sessions.
Primary and Secondary Shells
Primary and secondary shells are used a little differently
under OS/2 than you may be used to under DOS. In particular,
primary shells are more common in OS/2 and secondary shells
are less common.
When you boot DOS, there is only one primary shell: the one
loaded when your system boots. Under OS/2, a new primary
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 13
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
shell starts whenever a new character-mode session is started
from the desktop. If the session is an OS/2 session, a 4OS2
(or CMD.EXE) primary shell is used. If it is a DOS or Windows
session, a 4DOS (or COMMAND.COM) primary shell is used.
Secondary shells are used most often under DOS for "shelling
to DOS" from an application, and for starting DOS sessions
under multitaskers or task switchers like Back & Forth,
DESQview, or Microsoft Windows. Most OS/2 applications don't
offer a "shell to DOS" capability, and new sessions create
primary, not secondary shells. As a result, 4OS2 secondary
shells are generally created only for pipes (see page 19), or
when you start a second copy of 4OS2 directly from the command
prompt.
High Performance File System (HPFS)
OS/2 version 2.0 includes support for two different file
systems. The first is the traditional DOS file system that is
based on a file allocation table (FAT) and has file names that
are composed of 8 characters plus a 3-character extension.
The second file system is called the High Performance File
System or HPFS. In this system, file names can be a maximum
of 255 characters. The names may include spaces and other
characters that are not allowed in the FAT file system.
The file system type (FAT or HPFS) is determined when a hard
disk partition is formatted, and applies to the entire
partition. For example, you might have a 200 MB hard disk
divided into four 50 MB partitions, with the first three
partitions (C:, D:, and E:) formatted for the FAT file system
and the fourth (F:) formatted for HPFS. Partition F: would
then be available only from OS/2 sessions (including DOS
sessions running under OS/2). It would not be visible from a
normal DOS boot.
4OS2 is compatible with both file systems. Any command that
accepts file names will accept both FAT-compatible names and
HPFS-compatible names. If an HPFS-compatible name includes
spaces or other characters that would not be allowed in a FAT
name, you must place quotation marks around the entire name.
For example, suppose you have a file named LET3 on a FAT
partition, and you want to copy it to the LETTERS directory on
drive F:, an HPFS partition, and give it the name LETTER TO
SARA. To do so, use either of these commands:
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 14
CHAPTER 2 / GENERAL CONCEPTS
___________________________________________________________________
[c:\wp] copy let3 f:\"letter to sara"
[c:\wp] copy let3 "f:\letter to sara"
Note that the quotes can include the filename only, or the
entire path. As long as the portion of the filename which
includes spaces or other similar separator characters is
quoted, the filename will be interpreted properly.
HPFS is called an "installable file system" (installed with
the IFS= directive in CONFIG.SYS). OS/2 supports (but does
not include) additional installable file systems. 4OS2 will
work properly with any installable file system which supports
standard OS/2 file access calls.
Extended Attributes
DOS allows you to define a limited set of attributes for
files, for example whether the file is Read-Only, Hidden, or
System (for more information see pages 47 - 48 of the 4DOS
manual). OS/2 supports a new type of information about files
called "Extended Attributes" or "EAs".
The Extended Attributes for a file provide additional
information about the file which is not part of the file's
actual contents. This information might include the icon to
be displayed for the file on the OS/2 desktop or the type of
data contained in the file.
Extended Attributes are supported for both FAT and HPFS disk
volumes. EAs for the files on a particular drive are stored
in the file "EA DATA. SF" in the drive's root directory. Like
CMD.EXE, 4OS2 preserves a file's EAs when copying or moving
the file, and makes the appropriate adjustments to EAs when a
file is deleted or renamed.
4DOS cannot access Extended Attributes, and will not preserve
them or adjust the EA file when files are copied, moved,
deleted, or renamed. Therefore you should be sure to use 4OS2
rather than 4DOS to manipulate files which have EAs.
For more information on Extended Attributes, see your OS/2
documentation.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 15
CHAPTER 3 / USING 4OS2
___________________________________________________________________
CHAPTER 3 / USING 4OS2
In use, 4OS2 is nearly identical to 4DOS. The few differences
are explained in this chapter. We have assumed in this
chapter that you have the 4DOS Reference Manual available and
that you have some familiarity with the corresponding 4DOS
features.
If a section of this chapter seems completely unfamiliar to
you, it is probably discussing a feature of 4DOS and 4OS2
which you are not using. Feel free to read only the sections
of this chapter that are relevant to the way that you use your
computer and 4OS2.
At the Command Line
[see page 55 in the 4DOS Reference Manual]
For compatibility with CMD.EXE, the 4OS2 command line will
hold a maximum of 299 characters, instead of the 255
characters available at the 4DOS command line. All other
command line editing features work the same under 4OS2 as they
do under 4DOS.
The default 4OS2 prompt is [$p] on hard disk partitions and
[$n] on floppy disks, rather than the corresponding defaults
of $p$g and $n$g in 4DOS. This default is compatible with
CMD.EXE, and encloses the current path or drive in square
brackets. When OS/2 is installed it inserts a SET PROMPT
statement in CONFIG.SYS to set the prompt to $i[$p] . This
prompt will override 4OS2's default (it will not affect 4DOS).
It adds a header line to the default prompt, to remind you of
certain OS/2 keystrokes. You can modify or delete the SET
PROMPT line in CONFIG.SYS if you want to use a different
prompt for your 4OS2 sessions.
4OS2 HELP
Complete on-line help for all 4OS2 commands and features is
provided with 4OS2. As in 4DOS, help is invoked with the HELP
command or the F1 key. However, the 4OS2 help does not cover
the OS/2 external commands because they are included in OS/2's
general help.
When you start the 4OS2 Help system, 4OS2 opens a new OS/2
Presentation Manager session to run VIEW.EXE, the standard
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 16
CHAPTER 3 / USING 4OS2
___________________________________________________________________
help program supplied with OS/2. VIEW displays the 4OS2 Help
information and lets you browse through it.
If you invoke VIEW from a windowed 4OS2 session, you will be
returned to that session when you are done with VIEW. If you
invoke VIEW from a full-screen session, you must manually
return to that session using standard OS/2 methods for
switching between sessions.
You can also keep the VIEW help window on the screen and
return to the 4OS2 session, switching between the two sessions
as needed. This may be useful when you are writing a batch
file, working on a complex command, or experimenting with
4OS2.
See page 30 for information about configuring 4OS2 help.
Shared History and Alias Lists
[see pages 57 and 94 in the 4DOS Reference Manual]
By default, 4OS2 will use the same history list and alias list
in all sessions and in both primary and secondary 4OS2 shells.
It keeps these lists in shared memory segments. This means
that the aliases that you define in one session will
immediately be available in copies of 4OS2 that are running in
other sessions. In addition, the history list, which is used
to record the commands that you type, is updated in all 4OS2
sessions whenever you type a command at any 4OS2 prompt.
If you want to start a 4OS2 shell or session with unique alias
and history lists, use the LocalLists directive in the
4OS2.INI file (see page 29) or //LocalLists on the 4OS2
command line (see page 27). Using the 40S2.INI directive is
the best choice if you want to have separate alias and history
lists for all 4OS2 sessions. You might prefer using the
command line directive if you want to create a separate list
just for one particular session or shell.
The memory segments that contain the shared history and alias
lists are retained as long as there is at least one copy of
4OS2 running that supports shared lists. When all such copies
of 4OS2 end, the shared history and alias lists are discarded.
A utility program called SHRALIAS.EXE is included on the 4OS2
distribution diskette. It will keep these lists open until
your computer is rebooted. To use this program, include the
following line in your STARTUP.CMD, 4START, or 4OS2 session
startup batch file:
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 17
CHAPTER 3 / USING 4OS2
___________________________________________________________________
[d:\path\]shralias
Once SHRALIAS is started it will remain active until your
computer is turned off or rebooted, even if the session from
which it was started is terminated. To deactivate SHRALIAS,
enter this command at any 4OS2 prompt:
[d:\path]shralias /u
Multiple Commands
[see page 62 in the 4DOS Reference Manual]
In order to maintain compatibility with CMD.EXE, the default
command separator in 4OS2 is the ampersand [&]. You may
select a different symbol with the CommandSep directive in the
4OS2.INI file or the SETDOS /C command.
If you want to share batch (.BTM) files between 4OS2 and 4DOS,
you will probably want to select the same command separator
for both programs.
Escape Character
[see page 91 in the 4DOS Reference Manual]
In order to maintain compatibility with CMD.EXE, the default
escape character in 4OS2 is the caret [^]. You may select a
different symbol with the EscapeChar directive in the 4OS2.INI
file or the SETDOS /E command.
If you want to share batch (.BTM) files between 4OS2 and 4DOS,
you will probably want to select the same escape character for
both programs.
Redirection
[see page 66 in the 4DOS Reference Manual]
In addition to the extended 4DOS redirection options, 4OS2
also the supports the OS/2 (CMD.EXE) syntax
n>
and
>n
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 18
CHAPTER 3 / USING 4OS2
___________________________________________________________________
where [n] is a digit between 0 and 9. The n> syntax redirects
standard output to handle n; >n redirects handle n to
standard output. By definition, OS/2 interprets "0" as
standard input, "1" as standard output, and "2" as standard
error. Digits 3 through 9 can be defined (and redefined) by
individual application programs.
Piping
[see page 68 in the 4DOS Reference Manual]
A pipe takes the standard output of one program (the sending
program) and uses it as the standard input of a second program
(the receiving program). Because of the limitations of MS-
DOS, 4DOS implements pipes by creating a temporary file to
collect the output from the sending program. Once that
program is done, 4DOS starts the receiving program and sends
it the contents of the temporary file as its input. When the
receiving program ends, 4DOS deletes the temporary file.
The flexibility of OS/2 lets 4OS2 implement pipes by starting
a new process for the receiving program. The sending and
receiving programs run simultaneously; the sending program
writes to the pipe and the receiving program reads from the
pipe. When both programs finish, the process for the
receiving program is automatically ended.
If you are used to using pipes under 4DOS, you normally will
not see any difference with a 4OS2 pipe except perhaps less
disk activity. But you may not get the results you expect
from 4OS2 if you use a pipe command like
[c:\]echo test | input %%var
In 4DOS, this pipe will create an environment variable called
VAR and set its value as "test." You will be able to see the
new variable by typing SET at the 4DOS command.
In 4OS2, VAR will be set in the environment that belongs to
the receiving program. But that environment will be discarded
when the pipe has been emptied and the process ends. You will
never see VAR in the environment even though 4OS2 and OS/2 are
both operating correctly.
The same cautions apply to the "pipe-fitting" commands, TEE
and Y. When you use pipes with 4OS2, make sure you think
about any possible consequences that can occur from using a
separate process to run the receiving program.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 19
CHAPTER 3 / USING 4OS2
___________________________________________________________________
4OS2 Internal Variables
[see page 79 in the 4DOS Reference Manual]
The following internal variables are unique to 4OS2:
_PID is the current process ID number.
_PPID is the process ID number of the parent process.
_SID is the session ID number.
_PTYPE is the current OS/2 process type:
AVIO Character mode, windowed
DT Detached (no screen in use)
FS Character mode, full-screen
PM Presentation Manager
The following 4DOS internal variables are not available in
4OS2:
_ALIAS (because 4OS2 dynamically sizes the alias list).
_DV (because DESQView does not run under OS/2).
_ENV (because the environment size is adjusted
dynamically by 4OS2).
_WIN (because Windows does not run in the OS/2 character-
mode sessions used to run 4OS2).
4OS2 Variable Functions
[see page 83 in the 4DOS Reference Manual]
The following variable functions are available only in 4OS2:
@EXETYPE[filename]: Returns the application type as a
string:
DOS DOS .COM, .EXE, or .BAT file (OS/2 2.0
only)
AVIO OS/2 Character-mode, windowed
FS OS/2 Character mode, full-screen
PM OS/2 Presentation Manager
WIN Windows 3.x (OS/2 2.0 only)
@FSTYPE[d:]: Returns the file system type for the
specified drive. Normally, it will return "FAT" for a
DOS-compatible drive with a file allocation table or
"HPFS" for a drive that uses OS/2's high performance file
system. Other values may be returned by any additional
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 20
CHAPTER 3 / USING 4OS2
___________________________________________________________________
file systems installed with the IFS= directive in
CONFIG.SYS.
The following 4DOS variable functions are not available in
4OS2:
@EMS (because OS/2 does not recognize nor use expanded
memory).
@EXTENDED (because OS/2 does not recognize extended
memory as a special memory type).
@LPT (because there is no feasible way to read printer
status information directly under OS/2).
@REMOVABLE (because there is no feasible way to detect
removable drives under OS/2)
@TRUENAME (because there is no feasible way to detect
true names under OS/2).
@XMS (because OS/2 does not recognize nor use XMS
memory).
Batch Files
4OS2 can execute two kinds of batch files: files with an
extension of .CMD and those with an extension of .BTM. The
former are traditional OS/2 batch files; the latter can be
run by 4OS2 and by 4DOS running either under DOS or in a DOS
session under OS/2.
If you run the same .BTM files with 4OS2 and 4DOS, you should
encounter few difficulties. However, 4OS2 and 4DOS by default
use a different command separator and a different escape
character. You might want to use the CommandSep and
EscapeChar directives in either 4OS2.INI or 4DOS.INI to set
the same separator and escape character in both products (see
page 18).
Inside a .BTM file, you can use combinations of IF %_DOS and
IF %_DOSVER, to determine whether the file is being executed
by 4OS2, by 4DOS running under DOS, or by 4DOS in a DOS
session under OS/2.. You can also use IF %_SHELL to determine
whether the file is being executed by a primary or secondary
shell in either environment.
The template below should help you write .BTM files that can
run successfully in each possible environment. It includes
detection of several different environments but does not cover
all possibilities. The basic rule is to use the internal
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 21
CHAPTER 3 / USING 4OS2
___________________________________________________________________
variable %_DOS to determine the operating system, %_DOSVER to
determine the operating system version, and %_SHELL to
determine the shell level. Note that in a DOS session
%_DOSVER returns 3.3, 5.0, etc. for the corresponding MS-DOS
versions, 10.2 or 10.3 for the OS/2 version 1.2 or 1.3 DOS
Compatibility Box, and 20.0 for an OS/2 version 2.0 VDM. In
an OS/2 session %_DOSVER returns the true OS/2 version (e.g.
1.2 or 2.0).
[commands here for both 4OS2 and 4DOS]
if "%_DOS" == "DOS" then
[commands here for all 4DOS shells]
iff %_DOSVER eq 20.0
[commands here for OS/2 2.0 VDMs]
endiff
iff %_SHELL == 0
[commands here for 4DOS primary shells]
endiff
else
[commands here for all 4OS2 shells]
iff %_DOSVER eq 1.3
[commands here for 4OS2 under OS/2 1.3]
elseiff %_DOSVER eq 2.0
[commands here for 4OS2 under OS/2 2.0]
endiff
iff %_SHELL ne 0
[commands here for all 4OS2 secondary shells]
endiff
4OS2 Startup and Exit Files
4OS2 uses three startup or exit batch files: STARTUP.CMD,
4START, and 4EXIT. The first is run automatically whenever
OS/2 starts. 4START is run whenever 4OS2 starts, and 4EXIT is
run whenever 4OS2 exits. 4START and 4EXIT can be either .CMD
or .BTM files. If they have an extension of .BTM, they will
also run whenever 4DOS starts and exits if they are in a
directory where 4DOS can find them.
Using STARTUP.CMD
If you have a STARTUP.CMD file in the root directory of your
OS/2 boot drive, OS/2 will automatically create a windowed
4OS2 session when the system boots and tell that session to
execute STARTUP.CMD.
You can use STARTUP.CMD to start other sessions, to set up a
global alias list, etc., just as you might use AUTOEXEC.BAT
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 22
CHAPTER 3 / USING 4OS2
___________________________________________________________________
under DOS. STARTUP.CMD will be executed once, when your
system boots, not every time a 4OS2 session is started.
If you place the command EXIT at the end of STARTUP.CMD, the
session will end when that command is executed, and any global
alias list will be discarded if no other 4OS2 session has been
started and SHRALIAS has not been loaded (see page 17).
Otherwise, the session will remain open and can be used as a
normal windowed 4OS2 session.
Using 4START and 4EXIT
If you create a 4START.BTM and 4EXIT.BTM file, you can use
them for both 4OS2 and 4DOS. The template above shows how to
include commands that are specific to each operating system.
If you prefer to use different files for 4OS2 and 4DOS, you
can use 4START.CMD for 4OS2 and 4START.BAT for 4DOS. You
could name your 4EXIT files similarly.
If you prefer, you can create a file with a name other than
4START (for example, STARTOS2.CMD) and put its name in the
Parameters field for any 4OS2 icon (see page 26). Doing so
has two advantages. The file will only be started when a
primary 4OS2 shell is started, not under a secondary shell or
under 4DOS. Also, you can then use different startup files
for different 4OS2 sessions. Note that this file will not be
run by the "automatic" session that OS/2 starts at boot time
to run STARTUP.CMD. If you want it to run at that time also,
you will have to CALL it from STARTUP.CMD.
REXX Support
REXX is a file and text processing language developed by IBM
and included within OS/2. REXX files have a .CMD extension,
just like normal batch files, but the first two characters in
the file are always [/*], which indicate the beginning of a
REXX comment.
4OS2 checks to see if the first two characters on the first
line of a .CMD file are [/*]. If so, it passes the file to
OS/2's built-in REXX facility for processing. Any commands in
the REXX file which are not recognized by REXX will be passed
back to 4OS2. This allows you to embed any valid 4OS2 command
(including internal commands and aliases) within a REXX file
which is started from 4OS2. You can also force REXX to pass
commands to 4OS2 by enclosing those commands in single
quotation marks.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 23
CHAPTER 3 / USING 4OS2
___________________________________________________________________
For more information on REXX see your OS/2 documentation.
EXTPROC Support
OS/2 also offers an "external processor" (EXTPROC) option for
batch files which lets you define an external program to
process a particular .CMD file.
4OS2 supports EXTPROC in the same way as CMD.EXE. To identify
a .CMD file to be used with an external processor, place the
string "EXTPROC" as the first word on the first line of the
file followed by the name of the external program which should
be called. 4OS2 will start the program and pass it the name
of the .CMD file and any command line arguments which were
entered. 4OS2 will look for the external processor in the
current directory and then in each directory in the PATH.
4OS2 will start the external processor in the current session,
if possible, and wait for it to finish. If the external
processor's application type is incompatible with the current
session, 4OS2 will begin a new session for it and wait until
that session ends before returning to the command prompt.
For example, suppose GETDATA.CMD contains the following lines:
EXTPROC D:\DATAACQ\DATALOAD.EXE
OPEN PORT1
READ 4000
DISKWRITE D:\DATAACQ\PORT1\RAW
Then if you entered the command:
[d:\dataacq>] getdata p17
4OS2 would read the GETDATA.CMD file, determine that it began
with an EXTPROC command, read the name of the processor
program, and then execute the command:
D:\DATAACQ\DATALOAD.EXE D:\DATAACQ\GETDATA.CMD p17
The hypothetical DATALOAD.EXE program would then be
responsible for reopening the GETDATA.CMD file, ignoring the
EXTPROC line at the start, and interpreting the other
instructions in the file. It would also have to respond
appropriately to the command line parameter entered (p17).
For more information on external batch file processors see
your OS/2 documentation.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 24
CHAPTER 3 / USING 4OS2
___________________________________________________________________
Do not try to run 4OS2 or CMD.EXE as an external processor
with EXTPROC. Both programs will interpret the EXTPROC line
as a command to re-open themselves. The result will be an
infinite loop that will continue until the computer runs out
of resources and locks up.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 25
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
CHAPTER 4 / CONFIGURATION AND TUNING
[see page 107 in the 4DOS Reference Manual]
4OS2 can be configured in three different ways: with command-line
options, through its initialization file, and via the SETDOS
command. The SETDOS command is described on page 45 of this manual
and page 280 of the 4DOS Reference Manual. Command line options
and the initialization file are described in this chapter. This
chapter also discusses how to configure the 4OS2 help system and
how to use 4DOS effectively in DOS sessions.
Creating and Configuring 4OS2 Icons
You can create as many 4OS2 icons as you wish on the OS/2
desktop. Different icons can be used to start 4OS2 in
different modes, with different startup commands or options,
or to run different batch files or other commands. You can
use these icons to run commonly-used commands and batch files
directly from the OS/2 desktop.
Each icon represents a different 4OS2 session and you can set
up any of these sessions to run in windowed or full-screen
mode. You can also set any necessary command line parameters
for 4OS2 such as a command to be executed, any desired
switches, and the name and path for 4OS2.INI. More
information on command line switches and options for 4OS2, and
on 4OS2.INI, is included later in this section.
For general information on creating and configuring icons, see
page 12. For additional details, see your OS/2 documentation.
When you configure a 4OS2 icon, place command line parameters
that you want passed to 4OS2 (e.g. @ininame) into the
Parameters field for the icon.
To run a startup batch file for a particular 4OS2 session,
include its name (with a path, if the batch file is not in the
session's startup directory) as the last item in the
Parameters field. That batch file will be executed after any
4START file but before the first prompt is displayed. You can
use the batch file to set environment variables and execute
any other 4OS2 commands. You can also execute any internal
4OS2 command, external command, or alias by placing its name
in the Parameters field. When you set up a batch file or
other command to run in this way you are using the command
command line option (see below).
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 26
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
To execute an internal or external command, an alias, or a
batch file and then exit (return to the desktop) when it is
done, place /C command (rather than just command) as the last
item in the Parameters field.
If 4OS2 is installed in your CONFIG.SYS file and for some
reason you wish to run the default OS/2 shell, CMD.EXE, you
can set up an icon for it by creating a new icon and
specifying the full path name of CMD.EXE rather than [*] as
the file to run.
4OS2 Command Line Options
The 4OS2 command line does not need to contain any
information. When invoked with an empty command line, 4OS2
will configure itself from the 4OS2.INI file, run 4START, and
then display a prompt and wait for you to type a command.
However, you may add information to the 4OS2 command line that
will affect the way it operates.
Command line options for primary shells are set in the
Parameters field of the 4OS2 icon. If you need help finding
and setting the Parameters field for your version of OS/2, see
page 12. Command line options for secondary shells can be set
using 4OS2.INI file directives, or typed on the command line
itself following the program name if the shell is started from
a prompt.
4OS2 recognizes 5 optional fields on the command line. If you
use more than one of these fields, their order is important.
The syntax for the commands is
[d:\path] [@d:\path\inifile] [/S] [//iniline]... [/C |
/K] [command]
In this syntax statement, items in square brackets are
optional. The //iniline option may be repeated.
In the descriptions below of each of these optional fields, d:
means a drive letter and \path means a subdirectory name.
d:\path 4OS2 will use this directory and path to set the
COMSPEC environment variable for this session.
If this option is not used, COMSPEC is set from
the location of 4OS2.EXE. Since 4OS2 always
knows what drive and directory it was started
from, there is little reason to use this option.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 27
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
It is included only for compatibility with OS/2's
default shell program, CMD.EXE. This option
cannot be used for secondary shells.
@d:\path\inifile
This option sets the path and name of the
4OS2.INI file, which is discussed below. You do
not need this option if you aren't using a
4OS2.INI file. Nor do you need this option if
the file is named 4OS2.INI and it is in the same
subdirectory as 4OS2.EXE or in the root directory
of the same drive. Otherwise, this option must
be included. This option is most useful if you
want to start a 4OS2 session with a specific and
unique INI file.
/S This option tells 4OS2 that you do not want it to
set up a Ctrl-C / Ctrl-Break handler. It is
included for compatibility with CMD.EXE, but it
may cause the system to operate incorrectly if
you use this option without other software to
handle Ctrl-C and Ctrl-Break. This option should
be avoided by most users. This option cannot be
used for secondary shells.
//iniline This option tells 4OS2 to treat the text
appearing between the // and the next space or
tab as a 4OS2.INI directive (see below for a
discussion of 4OS2.INI). The directive should be
in the same format as a line in 4OS2.INI, but it
may not contain spaces, tabs, or comments. This
option overrides any corresponding directive in
your 4OS2.INI file. This option is a convenient
way to send 4OS2 one or two simple directives
without modifying or creating a new 4OS2.INI
file.
[/C | /K] command
This option tells 4OS2 to run a command when it
starts. The command will be run after 4START has
been executed, and before any command prompt is
displayed. It can be any valid internal or
external command, batch file, or alias command,
and you may include multiple commands by using
the command separator. All other startup options
(such as //iniline) must be placed before the
command, because 4OS2 will treat characters after
the command as part of the command and not as
additional startup options.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 28
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
When the command is preceded by a /C, 4OS2 will
execute the command and then exit and close the
session and return to the parent program, without
displaying a prompt.
The /K switch has no effect; using it is the same
as placing the command (without a /C or /K) at
the end of the startup command line. It is
included only for compatibility with CMD.EXE.
Using 4OS2.INI
4OS2 uses a file of initialization information called the
4OS2.INI file. You can add to and edit this file with any
ASCII text editor to set 4OS2 options and alter the way that
4OS2 works. Most of this section explains the options
available through 4OS2.INI. You only need to include entries
in 4OS2.INI for any settings that you want to change from
their default values. If you are happy with all of the
default values, you don't need a 4OS2.INI file at all.
Some settings in 4OS2.INI are initialized when you install
4OS2, so you may have a 4OS2.INI file even if you didn't
create one yourself. You should not delete this file unless
you've checked carefully to be sure that you don't need any of
the settings the initialization program put there.
In general, the 4OS2.INI file works the same as the 4DOS.INI
file described on page 116 of the 4DOS Reference Manual. The
following paragraphs only describe the differences between the
two files and the way they are processed.
4OS2.INI Directives
The following directives are used only in 4OS2:
HelpBook = string (4OS2+CMDREF): Sets the names of the
"books" to be loaded when 4OS2 help is invoked with the
HELP command or the F1 key. The default is 4OS2+CMDREF
which loads the 4OS2 help and the OS/2 command reference.
See the next section for details about the use of this
directive.
LocalLists = Yes | NO: Normally, 4OS2 shares alias and
history lists among all running shells. Set to "yes" to
force use of local alias and history lists instead of
shared global lists.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 29
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
WindowCol = nnnn; WindowHeight = nnnn; WindowRow =
nnnn; WindowWidth = nnnn: These directives set the
initial position and size of the 4OS2 session window in
pels. The position 0,0 is the bottom left corner of the
screen. WindowCol and WindowRow set the bottom left
corner of the 4OS2 window; WindowHeight and WindowWidth
set its size. Set WindowWidth to 2048 to maximize the
window, in which case the other values will be ignored.
The default is to leave the window wherever OS/2 puts it.
The following 4DOS.INI directives may not be used in a
4OS2.INI file. These directives are specific to DOS features
or limitations which do not exist in OS/2:
Alias LineInput
ANSI MessageServer
AutoExecPath NetwareNames
DiskReset Reduce
DVCleanup ReserveTPA
EnvFree StackSize
Environment Swapping
FineSwap SwapReopen
FullINT2E UMBEnvironment
HelpOptions UMBLoad
HelpPath UniqueSwapName
Configuring 4OS2 Help
In order for the 4OS2 help system to work properly, both
VIEW.EXE and the help text file, 4OS2.INF, must be in their
proper locations. VIEW.EXE is normally stored in the \OS2
directory. This directory must be included in your PATH (as
it normally is) so that 4OS2 can find and start VIEW.
During automated installation, 4OS2.INF is copied to your 4OS2
installation directory. VIEW must be able to find this file
or you will receive a "file not found" message box and no help
will be displayed. VIEW looks for help files in the
directories defined by the BOOKSHELF environment variable in
CONFIG.SYS. (BOOKSHELF, like PATH, contains a list of
directory names, separated by semicolons.)
You can make the 4OS2 help text available to VIEW by either
moving 4OS2.INF to the standard "book" directory shown on the
SET BOOKSHELF line in CONFIG.SYS (normally \OS2\BOOK), or by
adding the 4OS2 directory to the BOOKSHELF setting. The
latter method is the one used by 4OS2's automated installation
program.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 30
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
OS/2 includes a complete reference to all internal and
external commands in the reference book named CMDREF. This
book is stored in the file \OS2\BOOK\CMDREF.INF. In addition,
we include with 4OS2 a complete help reference for 4DOS, so
that you can develop and edit 4DOS batch files and aliases
while working under OS/2. The book name for this text is 4DOS
and the file name is 4DOS.INF. In order to use these files,
they must also be accessible to VIEW through the BOOKSHELF
variable.
4OS2 normally passes the help file name "4OS2+CMDREF" to VIEW,
which then opens the 4OS2 help text and the OS/2 command
reference. However, you can specify a different set of
"books" to be opened when HELP or F1 is invoked. To do so,
use the HelpBook directive in 4OS2.INI (see page 29).
For example, to set up 4OS2 so that all three books are
displayed when F1 is pressed, you would include the following
directive in 4OS2.INI:
HelpBook=4OS2+4DOS+CMDREF
When more than one book is listed in the HelpBook setting,
VIEW will see the combined group as a single book. The Table
of Contents displayed by VIEW will include the tables of
contents from all the listed books, concatenated together as
one group of topics with no divisions to show where one book
ends and the next begins.
If you wish, you can set up a separate icon for 4OS2 help
which can be invoked from your desktop. To do so, create an
icon with VIEW.EXE as the program name and 4OS2 in the
parameter field. To include other books in the table of
contents displayed when this session is started, use the plus
sign [+]. For example to make the icon show both 4OS2 and
4DOS help place 4OS2+4DOS in the parameters field.
Using 4DOS with OS/2
The combination of 4OS2 and 4DOS gives you a consistent user
interface whether you boot your computer with DOS or OS/2, and
whether you are in OS/2 character mode or running an OS/2 DOS
session. However, to use DOS, 4DOS, and OS/2 successfully
requires some planning if you want to get all of the power
possible out of each operating environment.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 31
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
This section explains some of the planning you should do and
some of the techniques you can use to get everything working
together correctly. Throughout this chapter, we assume that
you want to use 4DOS as your command processor when you boot
in native DOS mode and when you run a DOS session in OS/2, and
that you are using 4OS2 as your command processor in OS/2
character mode. Also, we assume that you have installed 4DOS
in the C:\4DOS\ directory and that 4DOS.INI plus your 4START
and 4EXIT files, if you have them, are also in that directory.
Startup Files
Before discussing the wide range of options you have for
configuring 4DOS and 4OS2 to work together, we thought it
would be useful to review the different startup files used
under DOS and OS/2, and the purpose of each. In the text
below, "boot drive" refers to the drive from which the
operating system boots. In most cases this will be drive C:
or drive A:, but if you are using OS/2 version 2.0's Boot
Manager (see below), you may boot OS/2 from another drive.
CONFIG.SYS Contains commands to configure the operating
system, load device drivers, and determine
the command processor to be used. Under
OS/2, commands in CONFIG.SYS provide this
information for both OS/2 itself and for DOS
sessions which run under OS/2. CONFIG.SYS
is stored in the root directory of the boot
drive.
AUTOEXEC.BAT Contains commands to be executed by the DOS
command processor (COMMAND.COM or 4DOS) when
a primary shell starts. AUTOEXEC.BAT is
stored in the root directory of the boot
drive. Under 4DOS, you can store it in a
different directory if you use the
AutoExecPath directive in 4DOS.INI.
4START Contains commands to be executed by 4DOS or
4OS2 when a primary or secondary shell
starts. A file named 4START.BTM will be
executed by both 4DOS and 4OS2; a file named
4START.BAT will be executed by 4DOS only;
and a file named 4START.CMD will be executed
by 4OS2 only. 4DOS and 4OS2 first look for
4START in the directory specified in the
4StartPath directive in 4DOS.INI or
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 32
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
4OS2.INI. If 4StartPath is not used, they
then look in the directory where 4DOS or
4OS2 themselves are stored, and finally in
the root directory of the boot drive.
4EXIT Contains commands to be executed by 4DOS or
4OS2 when a primary or secondary shell
exits. For details, see 4START above.
STARTUP.CMD Contains commands to be executed by a
special 4OS2 or CMD.EXE session which is
automatically started by OS/2 when it boots
if it finds STARTUP.CMD in the root
directory of the boot drive.
4DOS.INI Contains configuration commands for 4DOS
primary and secondary shells. 4DOS normally
searches for 4DOS.INI in the directory where
4DOS.COM is stored, then in the root
directory of the drive where 4DOS.COM is
stored, then in the root directory of the
boot drive. You can specify a different
location using the @ininame option on the
4DOS command line.
4OS2.INI Contains configuration commands for 4OS2
primary and secondary shells. 4OS2 normally
searches for 4OS2.INI in the directory where
4OS2.EXE is stored, then in the root
directory of the drive where 4OS2.EXE is
stored. You can specify a different
location using the @ininame option on the
4OS2 command line.
Methods of Booting
OS/2 includes two different methods of switching between
native DOS mode (a standard DOS boot, not an OS/2 "Native DOS
Session") and OS/2 itself. The first is to use the dual boot
software included with OS/2, which switches around CONFIG.SYS
and AUTOEXEC.BAT, and then reboots the computer. Dual boot is
invoked with the BOOT command (the program BOOT.COM)
distributed with OS/2. If you use the dual boot software, you
will have one copy of CONFIG.SYS and AUTOEXEC.BAT available on
your boot drive when you boot in DOS mode and another version
available when you boot in OS/2 mode.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 33
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
The Boot Manager (included with OS/2 version 2.0 only) uses a
different approach. It lets you install DOS on one hard drive
partition and OS/2 on another partition. When you boot the
computer, the Boot Manager displays a menu and lets you pick
which operating system to boot. Each partition will have its
own versions of CONFIG.SYS and AUTOEXEC.BAT.
The difference between these approaches is the location and
availability of files. If you use dual boot, all booting is
from the same drive. The startup files get switched back and
forth as you boot from one operating system or the other; the
set of files not in use at any given time is stored in the
\OS2\SYSTEM directory, and the set that is in use is stored in
the root directory of the boot drive. If you use the Boot
Manager, all startup files are available simultaneously.
However, the set of files for DOS resides on one drive (for
example, C) and the OS/2 set is on another drive (for example,
D).
In both cases, you are responsible for keeping files
synchronized. For example, if your DOS-mode AUTOEXEC.BAT file
and your OS/2 mode AUTOEXEC.BAT do essentially the same thing,
and if you want to add a new command, you have to remember to
update both files. One way to avoid doing so is to create a
new bootup batch file and make sure that both versions of
AUTOEXEC.BAT call it. Then you only have to maintain one file
of general boot information.
If you are using OS/2 version 2.0, there is one additional and
very important wrinkle. You can run multiple DOS sessions
(VDMs). Each time you start a new VDM, it will execute your
AUTOEXEC.BAT file, whether you want it to or not. We'll
explain below how to avoid running all of your AUTOEXEC.BAT
file in every VDM.
Setting Up OS/2 and 4DOS
First make sure that you have 4DOS set up to run properly from
a pure DOS boot. Use the 4DOS Reference Manual and the 4DOS
installation program to set your DOS-based CONFIG.SYS and
AUTOEXEC.BAT files the way you want them. Then boot in OS/2
mode or make sure that the OS/2 versions of these files are
available. The remainder of this section focuses on the OS/2
versions of CONFIG.SYS and AUTOEXEC.BAT, not the DOS versions.
Before you make any changes to CONFIG.SYS, AUTOEXEC.BAT, or
other bootup files, make sure that you have a bootable floppy
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 34
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
disk so that an error won't leave your system unbootable..
You're not likely to create such an error, especially under
OS/2, but this is always a wise precaution.
Now change the SHELL= line in your CONFIG.SYS file to read
SHELL=c:\4dos\4dos.com c:\4dos
The first part of that statement simply sets 4DOS.COM as your
shell program for DOS sessions. The second part specifies the
COMSPEC setting that will be used each time 4DOS is started as
a primary shell. The COMSPEC setting is required unless
4DOS.COM is stored in the root directory of your boot drive.
4DOS is generally able to determine the COMSPEC setting
automatically in a standard boot under MS-DOS or PC-DOS, but
it cannot do so in an OS/2 DOS session. You may want to add
other 4DOS options to the command line, as well; see page 108
in the 4DOS Reference Manual.
If you are using OS/2 version 1.x, the SHELL command in your
CONFIG.SYS file will determine how 4DOS boots up when you
invoke the DOS Compatibility Box from the OS/2 desktop.
If you are using OS/2 version 2.0, you can have multiple icons
for Virtual DOS Machines (VDMs). These may include icons in
the Command Prompts window, icons for "migrated applications,"
icons for DOS and Windows applications, and icons for batch
files. Each VDM icon contains its own information about how
to boot DOS. In essence, each VDM icon has its own CONFIG.SYS
file built into it.
To modify an icon's configuration information, use the DOS
Settings button on the Session tab in the Settings window (see
page 12 for more details on modifying the settings for an
icon). The setting labeled DOS_SHELL determines what command
processor to load when the icon is used to start a session;
it should be set to match the text following SHELL= in
CONFIG.SYS. For example, you might set the DOS_SHELL setting
to:
c:\4dos\4dos.com c:\4dos
Other settings modify other session characteristics, such as
available XMS and EMS memory, device drivers to load, and so
on.
If you create an icon by using a Program Template, the DOS
Settings information is read from the current CONFIG.SYS file.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 35
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
If you create a VDM icon by copying an existing icon, the
original icon's information will be used in the new icon.
Once you have the DOS settings correct, place a "*" in the
Program Name field (available on the Program tab in the
Settings window). This tells OS/2 to load the command
processor and go to a prompt, rather than running a specific
program within the session.
You may, of course, customize any icon with optional 4DOS
command line switches, such as "@" followed by a custom INI
file name, or "//" followed by an INI file command. These
switches can be placed at the end of the DOS_SHELL setting, or
in the Parameters field in the Program window.
When you first install OS/2 version 2.0, or if you change the
4DOS settings in CONFIG.SYS, you will need to correct the
DOS_SHELL setting in your existing VDM icons. Change
DOS_SHELL to match the text that follows SHELL= in your
CONFIG.SYS file.
Other 4DOS Considerations
Regardless of whether you use a dual boot system, the Boot
Manager, or boot only in OS/2, each DOS session starts 4DOS
(or COMMAND.COM) as a primary shell. 4DOS will execute your
AUTOEXEC.BAT file plus 4START. If the session starts as a VDM
under OS/2 version 2.0, it can be closed with the EXIT
command. When it is, 4DOS will run your 4EXIT file, if you
have one. This is different from DOS, where EXIT cannot be
used in a primary shell.
You may want to maintain separate AUTOEXEC.BAT files for
booting under DOS and under OS/2, or you may want a single
file that contains instructions for both boot modes. One way
to put instructions for both boot modes into a single file is
to use the IFF command and the %_DOSVER internal variable (see
page 22 for a detailed example).
If you are using the Boot Manager, you can put all of your
instructions in the DOS-mode AUTOEXEC.BAT file. Then your
OS/2-mode AUTOEXEC.BAT could simply be
cdd c:\
autoexec.bat
On a dual boot system, you could put all of your commands into
a third file (for example, SYSTART.BAT) and CALL it from both
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 36
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
your DOS-mode and OS/2-mode AUTOEXEC.BAT files. Or, you could
simply put your AUTOEXEC.BAT somewhere other than your root
directory and use the 4DOS.INI directive AutoExecPath to tell
4DOS where to find it.
You may also need to customize your 4START and 4EXIT files, if
you use them, for DOS mode and OS/2 mode. You can use the
internal variable %_DOS to separate commands for each
operating system. You will also have to make sure that 4DOS
can find its 4DOS.INI file along with 4START and 4EXIT.
Probably the best method is to put those files in the same
directory as 4DOS.COM and then make sure that COMSPEC is set
for that directory as described above.
If you use dual boot and want different 4DOS.INI files for DOS
mode and OS/2 mode, remember that the dual boot program does
not swap the 4DOS.INI files for you. Therefore, one of your
CONFIG.SYS files must invoke a different file using the
"@ininame" option on the SHELL= line.
If you run 4DOS in two or more Virtual DOS Machines that use
disk swapping, you can crash the system because each 4DOS
primary shell will use the same 4DOSSWAP.000 file. You can
avoid this problem if you make sure that each VDM has enough
XMS or EMS memory (use the EMS_MEMORY or XMS_MEMORY setting in
DOS Settings) and if both VDMs use 4DOS's default swapping.
You can also avoid the problem by varying the swap location
for each VDM's copy of 4DOS with a separate 4DOS.INI file or
with a "//swapping=" directive in the DOS_SHELL setting. A
future version of 4DOS will include a new 4DOS.INI directive,
UniqueSwapName, which will allow you to change to a different
naming convention for swap files to avoid this problem.
"Temporary" VDMs
So far, we have assumed that you want to start a VDM to run
4DOS and get to the DOS prompt. OS/2 version 2.0 also lets
you start a VDM for temporary purposes, such as running a DOS
application or a batch file from an icon. In such a temporary
VDM, 4DOS is still loaded as a primary shell even though it is
being invoked to run just a single command or application. It
is also loaded as a "transient" shell which exits (back to
OS/2) when its job is done. You probably don't want a
temporary VDM to load all the memory-resident utilities and
execute the other commands that you want when you are setting
up a DOS prompt. Most users would rather set up as simple a
VDM as possible, run the command, and exit as quickly as
possible.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 37
CHAPTER 4 / CONFIGURATION AND TUNING
___________________________________________________________________
The 4DOS internal variable %_TRANSIENT makes it easy to adjust
your AUTOEXEC.BAT to the job required. The beginning of your
AUTOEXEC.BAT file could look like this:
iff %_transient == 1 then
call setpath
call aliases
call setenv
quit
endiff
This fragment calls other batch files to set up the path,
aliases, and the environment, but it does not load TSRs. It
doesn't have to check the DOS version to see if it is running
under OS/2 because _TRANSIENT will never equal 1 in
AUTOEXEC.BAT unless it is being launched within a VDM.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 38
CHAPTER 5 / COMMAND REFERENCE GUIDE
___________________________________________________________________
CHAPTER 5 / COMMAND REFERENCE GUIDE
[see page 157 in the 4DOS Reference Manual]
The following commands are unique to 4OS2:
DETACH (start an OS/2 program in detached mode)
DPATH (set the search path for data files)
KEYS (alternate command to enable or display the history
list)
START (start a program in a new session)
All of these commands are described in detail on the following
pages.
In addition, DIR and SETDOS have different options available
in 4OS2 than they do in 4DOS. The new options available for
DIR support displays in either the high performance file
system (HPFS) or tradition DOS-compatible FAT format. SETDOS
in OS/2 does not have the ANSI and Line Input options that are
available in 4DOS. These changes are also described in detail
on the following pages.
The following 4DOS commands are not available in 4OS2:
BREAK LOADHIGH / LH
CTTY SWAPPING
KEYSTACK TRUENAME
Finally, the /M(aster environment) option is not available in
the 4OS2 versions of ESET, SET, and UNSET.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 39
CHAPTER 5 / COMMAND REFERENCE GUIDE / DETACH
___________________________________________________________________
DETACH
(Compatible)
Purpose: Start an OS/2 program in detached mode.
Format: DETACH filename
filename: the name of a file, including an optional
drive and path specification. The name may be
enclosed in quotation marks if it contains a space.
See also: START
Usage: When you start a program with DETACH, that program
cannot use the keyboard, mouse, or video display. It
is "detached" from the normal means of user input and
output. However, you can redirect the program's
standard I/O to other devices if necessary, using the
4OS2 redirection symbols.
If you specify an internal command or batch file
(either a .CMD or .BTM file) as the filename, 4OS2
will detach another copy of 4OS2.EXE to execute the
command.
For example, the following command will detach a copy
of 4OS2 to run the batch file XYZ.BTM:
[c:\]detach xyz.btm
Once the program has started 4OS2 returns to the
prompt immediately. It does not wait for a detached
program to finish.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 40
CHAPTER 5 / COMMAND REFERENCE GUIDE / DIR
___________________________________________________________________
DIR
(Enhanced)
[see page 198 of the 4DOS Reference Manual]
Purpose: Display information about files and subdirectories.
Format: DIR [/1 /2 /4 /A[[:][-]rhsda] /B /C /F /J /K /L /M /N
/O[[:][-]deginsu] /P /S /T /U /V /W /Z] [file...]
file: The file, directory, or list of files or
directories to display.
/1 (one column) /M (suppress footer)
/2 (two columns) /N (use HPFS format)
/4 (four columns) /O (sort order )
/A(ttribute select) /P(ause)
/B(are) /S(ubdirectories)
/C(ase -- use upper case) /T (aTtribute display)
/F(ull path) /U (sUmmary information)
/J(ustify names) /V(ertical)
/K (suppress header) /W(ide)
/L(ower case) /Z (use FAT format)
Usage: The DIR command is the same in 4OS2 and 4DOS, except
that the /N option has a new meaning and the /Z option
has been added. The 4DOS /N option, which resets DIR
to default values, has no equivalent in 4OS2.
Options: /N: Display the directory in OS/2 high performance
file system (HPFS) format.
/Z: Display the directory in DOS-compatible FAT
format. Long names on an HPFS drive will be truncated
to 11 characters. The name will be followed by a
solid right arrow symbol [a] to show that one or more
characters have been truncated.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 41
CHAPTER 5 / COMMAND REFERENCE GUIDE / DPATH
___________________________________________________________________
DPATH
(Compatible)
Purpose: Specify the subdirectories which applications will
search to find files that are not in the current
directory.
Format: DPATH [directory[;directory...]]
directory: The full name of a directory to include in
the DPATH (data path) setting.
See also: PATH, SET, and ESET in the 4DOS Reference
Manual.
Usage: When most OS/2 applications try to open a data file,
they look for the file in the current directory first.
If they fail to find the file there, they search each
of the directories in the DPATH setting in the order
that they are included.
For example, the following DPATH command directs
applications to look for files in the following order:
the current directory, the INIT directory on C, and
the CONFIG directory on D:
[c:\]dpath c:\init;d:\config
The listing of directories to be searched can be set
or viewed with the DPATH command. The list is stored
as an environment string with the variable name DPATH,
and can also be set or viewed with the SET command and
edited with the ESET command.
Directory names in the DPATH must be separated with
semicolons [;]. 4OS2 will not shift directory names
in DPATH to upper case as it does with those in the
PATH setting. If you want the names in the DPATH to
be in upper case you must enter them that way.
If you enter DPATH with no parameters, 4OS2 displays
the current DPATH search list.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 42
CHAPTER 5 / COMMAND REFERENCE GUIDE / KEYS
___________________________________________________________________
KEYS
(Compatible)
Purpose: Enable, disable, or display the history list.
Format: KEYS [ON | OFF | LIST]
See also: HISTORY in the 4DOS Reference Manual.
Usage: This command emulates the CMD.EXE KEYS command, which
controls the history list. It is provided for
compatibility with CMD.EXE. The same functions are
available by setting the HistMin directive in 4OS2.INI
and by using the HISTORY command in 4OS2.
Normally, the history list is enabled. It collects
the commands you type for later recall, editing, and
viewing. You can view the contents of the history
list through the history list window (see page 59 in
the 4DOS Reference Manual) or by typing any of the
following commands:
[c:\]history
[c:\]history /p
[c:\]keys list
The first command displays the entire history list.
The second displays the entire list and pauses at the
end of each full screen of data. The third command
produces the same output as the first, except that
each line is numbered.
You can disable the collection and storage of commands
in the history list by typing
[c:\]keys off
Once the history has been turned off, you can turn it
back on by typing
[c:\]keys on
If you issue the KEYS command without any parameters,
4OS2 will show you the current status of the history
list:
[c:\]keys
KEYS is ON
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 43
CHAPTER 5 / COMMAND REFERENCE GUIDE / KEYS
___________________________________________________________________
See page 17 for more information about how the history
list is stored.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 44
CHAPTER 5 / COMMAND REFERENCE GUIDE / SETDOS
___________________________________________________________________
SETDOS
(New)
[see page 280 of the 4DOS Reference Manual]
Purpose: Display or set the 4OS2 configuration.
Format: SETDOS [/C? /E? /I+|- command /M? /N? /R? /S?:? /U?
/V?]
/C(ompound) /R(ows)
/E(scape character) /S(hape of cursor)
/I(nternal commands) /U(pper case)
/M(ode for editing) /V(erbose)
/N(o clobber)
Usage: The SETDOS command is the same in 4OS2 as it is in
4DOS, except that two of the optional parameters are
not available in 4OS2 and their values are not
reported.
The /A(NSI) option and the ANSI directive in 4OS2.INI
are not available because 4OS2 enables ANSI support
and assumes that it remains enabled. You can turn off
ANSI support with OS/2's external ANSI command
(ANSI.EXE). If you do, however, 4OS2 will not notice
the change and will display unusual characters or
ignore colors in your CLS and COLOR commands. The
4OS2 internal variable %_ANSI reflects the state of
OS/2 established with ANSI.EXE.
The /L(ine) option and the LineInput directive in
4OS2.INI are not available because the "line input"
capability is not required for compatibility with OS/2
applications, as it may be under DOS.
In all other respects, the commands are the same. See
the 4DOS Reference Manual for a full description of
SETDOS.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 45
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
START
(Enhanced)
Purpose: Start a program in another session.
Format: START ["program title"] [/BG /DOS /C /F /FS /I
/ICON=filename
/INV /K /L /MAX /MIN /PGM progname /PM
/POS=row,col,width,height /WIN] [command]
program title: title to appear on title bar.
filename: name of icon (.ICO) file.
progname: program name (not the session name). The
name may be enclosed in quotation marks if it contains
a space.
/BG (background session) /K(eep when done)
/DOS (DOS session) /L(ocal lists)
/C(lose when done) /MAX(imized)
/F(oreground session) /MIN(imized)
/FS (full screen) /PGM (program name)
/I(nherit default envir.) /PM (PM application)
/ICON (name .ICO file) /POS(ition of window)
/INV(isible) /WIN(dowed session)
See also: DETACH in this manual.
Usage: START is used to begin a new session and, optionally,
to run a program in that session. If you use START
with no parameters, it will begin a new 4OS2 session.
If you add a command, START will begin a new session
and execute the command that you have specified.
START determines the application type automatically
and starts the session in the appropriate mode (full-
screen, windowed, or Presentation Manager).
If the program is a DOS application or .BAT file, 4OS2
will return an error message in OS/2 version 1.x. In
OS/2 version 2.0, 4OS2 will start a new DOS session to
run the program or batch file. The DOS session will
close itself automatically as soon as the program or
batch file ends. If you want the session to wait for
a keystroke before it closes itself, you can use the
syntax
[c:\] start /DOS progname ^^ pause
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 46
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
If you want to start a DOS command-line session in
OS/2 version 2.0, you can use the command
[c:\] start /DOS
START gives you some flexibility in determining the
session mode. For example, if the command is the name
of a batch file (either a .BTM or .CMD file), you can
use the /FS or /WIN options to run the batch file as
part of a new 4OS2 session in either full-screen or
windowed mode.
However, you cannot start a session in a mode that is
inappropriate for the application type. A batch file
can not be run as part of a Presentation Manager
session, for example, even if you use the /PM switch.
The session created by START is started in the
background unless the /F, /FS, /WIN, or /PM switch is
used.
The program title, if it is included, will appear on
the title bar and the Presentation Manager task list
(OS/2 version 1.x) or window list (OS/2 version 2.0).
The program title must be enclosed in quotation marks
and cannot exceed 60 characters in length. If the
program title is omitted, the program name will be
used as the task list name.
Options: /BG (BackGround session): The session is started as a
background session. This option can be used with /FS,
/WIN, and /PM.
/C(lose): The session is started using 4OS2.EXE and
is closed when the application ends.
/DOS (DOS session): Start a foreground DOS session in
a Virtual DOS Machine (OS/2 version 2.0). This option
is not available in OS/2 version 1.x, which doesn't
allow multiple DOS sessions.
/F(oreground session): Start the session as the
foreground session.
/FS (Full Screen): Start the session as a full-screen
foreground session.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 47
CHAPTER 5 / COMMAND REFERENCE GUIDE / START
___________________________________________________________________
/I(nherit environment): Inherit the default
environment specified in CONFIG.SYS rather than the
current 4OS2.EXE environment.
/ICON: Use the specified icon (.ICO) file. If you
don't specify an icon file with /ICON=filename, 4OS2
will look for an .ICO file with the same file name and
in the same directory as the program file.
/INV(isible): Start the session as invisible. No
icon will appear and the session will only be
accessible through the Task Manager or Window List.
/K(eep session at end): The session is run using
4OS2.EXE, and continues after the application program
ends. Use the EXIT command to end the session. This
is the default mode for all non-Presentation Manager
applications.
/L(ocal lists): Start 4OS2.EXE with local alias and
history lists. If you don't use this option, the
session will share the alias and history lists of the
current 4OS2 shell, unless a LocalLists=Yes directive
is used in 4OS2.INI.
/MAX(imized): Start the session maximized.
/MIN(imized): Start the session minimized.
/PGM (ProGraM name): The argument immediately
following this option is the program name, not the
session name.
/PM (Presentation Manager): Start a Presentation
Manager session in the foreground.
/POS(ition): Start the window at the specified screen
position. The full syntax is /POS=row, col, width,
height where the values are specified in pels. Row
and col are the bottom left corner of the window (the
bottom left corner of the screen is position 0,0).
/WIN(dowed): Start the session as a windowed
foreground session.
___________________________________________________________________
Copyright 1992, JP Software Inc. 4OS2 Reference Manual / 48